A template is a representation of an image of an object which aims to contain the image's salient features so that the template can be subsequently compared to other images, the goodness of fit of the template to another image providing a measure of the likelihood that this image is of or contains a sub-image of the object. For example, a series of templates may be formed from respective images of the faces of a group of people. An image of a person's face captured by a security camera could then be compared to the templates to determine if that person is one of the group.
A known approach to the use of templates is described in an article entitled "Feature Extraction From Faces Using Deformable Templates" by A L Yuille, D S Cohen and P W Hallinan, Harvard Robotics Laboratory Technical Report 33-2, 1988. In this approach a feature or object of interest is described by a geometric representation which is specified by a set of parameters which incorporate knowledge of the shape of the object. The article gives examples of two such templates; one for use in recognising an eye and the other a mouth. In the former case the eye template decided upon by the authors incorporated a circle corresponding to the outer boundary of the iris, boundary coutours corresponding to the top and bottom of the eye comprising two parabolas, regions corresponding to the whites of the eyes, and two points corresponding to the centres of the whites of the eyes.
The template of Yuille et al is deformable in that the components of the template can move subject to notional structural, restraining forces between the components. When the template is matched to a test image, the components of the template are attracted to various valleys, edge and peak components of the image which attractive forces are generally resisted by the structural forces between the components of the template. An energy function is defined in terms of the attraction of the template components to the features of the image and the structural forces resisting deformation of the template, the template being deformed to minimise this energy function. This energy function gives a measure of the goodness of fit of the template to the image and can be used as a measure of whether the template has, in fact, been successfully matched to the image, ie that the image does indeed correspond to the template.
This approach to the forming of templates was devised so that a priori information available about the appearance of the features of the object to which the template was to be matched, in Yuille et al's particular case facial features, could be incorporated into the template so providing a mechanism for detecting edges or other features which comprise local information as global structures.